package com.complex.client.service;



import com.complex.client.service.gen.*;
import javax.xml.namespace.QName;
import java.net.URL;

/**
* Created with IntelliJ IDEA.
* User: AGrankin
* Date: 27.08.13
* Time: 15:45
* To change this template use File | Settings | File Templates.
*/
public class DAOWebClient {
    private static final QName SERVICE_NAME = new QName("http://gen.example.com/first", "DAOWebServerService");
    private static DAOWebService daoWebService = null;

    private static DAOWebClient daoWebClient = null;

    private DAOWebClient(URL servUrl) {
        daoWebService = new DAOWebServerService(servUrl, SERVICE_NAME).getDAOWebServicePort();
    }

    public static DAOWebClient getInstance(URL servUrl) {
        if (daoWebClient == null) {
            daoWebClient = new DAOWebClient(servUrl);
        }

        return daoWebClient;
    }

    public DAOWebService getDAOWebService() {
        return daoWebService;
    }
}
